/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyClass;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.game.Sprite;

/**
 *
 * @author HuuTai_it
 */
public class About extends GameCanvas implements Runnable { 
    
    private Control control;
    private Image about = Image.createImage("/MyPicture/aboutscreen.png");
    private Image temp = Image.createImage(about, 0, 0, 240, 320, Sprite.TRANS_NONE);
    
    public About(Control control) throws Exception {
        
        super(true);
        setFullScreenMode(true);
        this.control = control;
    }
    public void start() {
        
        Thread t = new Thread(this);
        t.start();
    }
    public void run(){
        
        Graphics g = getGraphics();      
        long time = System.currentTimeMillis();        
        boolean keyState = false;
        
        for(int i = 0; i < 280;)
        {

            if(System.currentTimeMillis() - time > 50) {

                try {

                    temp = Image.createImage(about, 0, i++, 240, 320, Sprite.TRANS_NONE);
                }
                catch(Exception ex){}

                g.drawImage(temp, 0, 0,  Graphics.TOP | Graphics.LEFT);

                time = System.currentTimeMillis();  
            }
            
            flushGraphics();
        }
           
        while(!keyState)
           if(getKeyStates() == FIRE_PRESSED)
               keyState = true;

        control.showMainMenu();  
    }        
}
